﻿using SIG.Resources;
using SIG.Resources.Admin;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace SIG.InputModel.Admin.Store
{
    public class GoodsIM
    {
        public int Id { get; set; }
        [Display(ResourceType = typeof(Labels), Name = "GoodsName")]
        [Required(ErrorMessageResourceType = typeof(Validations), ErrorMessageResourceName = "Required")]
        public string Name { get; set; }

        [Display(ResourceType = typeof(Labels), Name = "Description")]
        public string Description { get; set; }

        [Display(ResourceType = typeof(Labels), Name = "Thumbnail")]
        public string Thumbnail { get; set; }

        [Required(ErrorMessageResourceType = typeof(Validations), ErrorMessageResourceName = "Required")]
        [Display(ResourceType = typeof(Labels), Name = "Category")]
        public int CategoryId { get; set; }

        [AllowHtml]
        [Display(ResourceType = typeof(Labels), Name = "Content")]
        public string FullDescription { get; set; }
        
        [Display(ResourceType = typeof(Labels), Name = "Price")]
        [Required(ErrorMessageResourceType = typeof(Validations), ErrorMessageResourceName = "Required")]
        [RegularExpression(@"^\d+.?\d{0,2}$", ErrorMessageResourceType = typeof(Validations), ErrorMessageResourceName = "InvalidFormat")]
        [Range(0, 9999999999999999.99, ErrorMessageResourceType = typeof(Validations), ErrorMessageResourceName = "DecimalFormat")]
        public decimal Price { get; set; }

        [Display(ResourceType = typeof(Labels), Name = "Active")]
        public bool Active { get; set; }

        [Display(ResourceType = typeof(Labels), Name = "KeyWords")]
        public string Keywords { get; set; }

        [Display(ResourceType = typeof(Labels), Name = "Description")]
        public string SEODescription { get; set; }
    }
}